<!--资金支付单-->
<template>
  <div>
    <f-search-form ref='search' :more='true' @searchHandler='searchHandler'>
      <f-search-form-item label='单号' name='paymentNo' />
      <f-search-form-item label='结算日期' type='range' name='beginDate' />
    </f-search-form>
    <f-table ref='table' rowKey='paymentId' :showSetting='true' setting-key='settle_tab3' :tableColumns='columns' :scroll='{x:1200}' handler='settlePayTab4PageListHandler' :showMultipleBtn='false' :operator='operator' :multiple='multiple' :params='queryParam' :api='api.payment'>
       <span slot='paymentState' slot-scope='text, record, index'>
            <a-tag color='#87d068' v-if='text==0'>未支付</a-tag>
            <a-tag color='#108ee9' v-if='text==1'>已支付</a-tag>
       </span>
      <span slot='action' slot-scope='text, record'>
          <template>
            <a @click='$refs.invoiceDetailsDrawer.showDrawer(record)'>明细</a>
          </template>
        </span>
    </f-table>
    <invoice-details-drawer ref='invoiceDetailsDrawer'></invoice-details-drawer>
  </div>
</template>
<script>
import api from "../../js/api"

import { processMixins } from "@/core/mixins/processMixins"
import InvoiceDetailsDrawer from "@/views/module/haiying/order/settle/components/invoice_details_drawer"

export default {
  name: "Tab4",
  components: { InvoiceDetailsDrawer  },
  mixins: [processMixins],
  data() {
    let me = this
    //操作按钮
    let operator = []
    return {
      api: Object.assign(api, this.api),
      multiple: false,
      deptId: "",
      //列表初始化查询参数
      queryParam: {
        auth: 1
      },
      returnCustomBond: 0,
      selectIds: "",
      params1: {
        deptId: ""
      },
      columns: [
        {
          title: "序号",
          width: "60px",
          align: "center",
          customRender: (text, record, index) => index + 1
        },
        {
          title: "开票日期",
          align: "center",
          width: "100px",
          dataIndex: "amountDate"
        },
        {
          title: "结算单号",
          align: "center",
          width: "120px",
          dataIndex: "paymentNo"
        },
        {
          title: "开票单位",
          align: "left",
          width: "150px",
          ellipsis: true,
          dataIndex: "invoiceUnitName"
        },
        {
          title: "收款人",
          align: "center",
          width: "80px",
          ellipsis: true,
          dataIndex: "saleManName"
        },

        {
          title: "结算金额",
          align: "center",
          width: "80px",
          dataIndex: "amount"
        },
        {
          title: "备注",
          align: "center",
          width: "80px",
          dataIndex: "remark"
        },
        {
          title: "申请人",
          align: "center",
          width: "80px",
          dataIndex: "nickName"
        },
        {
          title: "申请日期",
          align: "center",
          width: "80px",
          dataIndex: "amountDate"
        },
        {
          title: "状态",
          align: "center",
          width: "80px",
          dataIndex: "paymentState",
          scopedSlots: { customRender: "paymentState" }
        }, {
          title: "操作",
          align: "center",
          dataIndex: "action",
          width: "80px",
          scopedSlots: { customRender: "action" }
        }
      ],
      operator: operator
    }
  },
  created() {
  },
  methods: {
    setData() {
    },
    //部门切换
    deptChange(value) {
      this.queryParam.deptId = value
      this.$refs.table.refresh(false)
    },
    /**
     * 查询事件
     * @param searchParams
     */
    searchTable(searchParams) {
      this.queryParam = Object.assign(this.queryParam, searchParams)
      this.$refs.table.refresh(true, searchParams)
    },
    openMultiple(searchParams) {
      if (searchParams.deptId) {
        this.multiple = true
        this.deptId = searchParams.deptId
      }
    },
    /**
     * 刷新列表
     */
    onLoad() {
      this.$refs.table.refresh()
      this.$emit("changeTab")
    }
  }
}
</script>
supplierBondState